package com.squid.cloud.common.enums;

public enum FakeAccountEnum {
	
	COUPON("COUPON","优惠账户"),
	DISCOUNT("DISCOUNT","折扣账户"),
	TOTAL("TOTAL","总账户"),
	FEE("FEE","手续费账户");

	/**
	 * 枚举值
	 */
	private final String code;

	/**
	 * 枚举描述
	 */
	private final String message;

	/**
	 * 构造一个<code>PasswordLevelEnum</code>枚举对象
	 *
	 * @param code
	 * @param message
	 */
	private FakeAccountEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}
	public static String getValue(String code){
		for(FakeAccountEnum genum : FakeAccountEnum.values()){
			if(genum.code.equals(code)){
				return genum.message;
			}
		}
		return null;
	}
	
	public static String getCode(String value){
		for(FakeAccountEnum genum : FakeAccountEnum.values()){
			if(genum.message.equals(value)){
				return genum.code;
			}
		}
		return null;
	}
	
	public static FakeAccountEnum getByCode(String code) {
		for(FakeAccountEnum genum : FakeAccountEnum.values()){
			if(genum.code.equals(code)){
				return genum;
			}
		}
		return null;
	}
	
	public String code() {
		return code;
	}

	public String message() {
		return message;
	}
}
